#include "settings_dialog.hpp"

#include <QDialogButtonBox>
#include <QLayout>
#include <QTabWidget>

namespace FRAMEWORK {
namespace SETTINGS {

/*****************************************************************************/

Dialog::Dialog ( QWidget *xParent )
  : QDialog ( xParent ) {

  QVBoxLayout *M = new QVBoxLayout( this ) ;
  M->setSpacing ( 6 ) ;
  M->setMargin  ( 9 ) ;

  QTabWidget *TW = new QTabWidget( this ) ;
  M->addWidget ( TW ) ;

  {
    Plugins *P = pPlugins = new Plugins ;
    TW->addTab( P, tr("Plugins") ) ;
  }

  QDialogButtonBox *BB = new QDialogButtonBox( this ) ;
  BB->addButton( tr( "OK"    ), QDialogButtonBox::AcceptRole ) ;
  BB->addButton( tr( "Cancel"), QDialogButtonBox::RejectRole ) ;
  connect ( BB, SIGNAL(accepted()), pPlugins, SLOT(accept()) ) ;
  connect ( BB, SIGNAL(accepted()), this,     SLOT(accept()) ) ;
  connect ( BB, SIGNAL(rejected()), this,     SLOT(reject()) ) ;
  M->addWidget( BB ) ;

}

/*****************************************************************************/

Dialog::~Dialog() {
}

/*****************************************************************************/

} // namespace SETTINGS
} // namespace FRAMEWORK
